import { request } from 'umi';

export type LoginParamsType = {
  username: string;
  password: string;
  mobile: string;
  captcha: string;
  type: string;
};

export async function accountLogin(params: LoginParamsType) {
  return request<API.LoginStateType>(`${process.env.hostname}/api/login/account`, {
    method: 'POST',
    requestType: 'form',
    data: params,
  });
}

export async function outLogin() {
  return request(`${process.env.hostname}/api/login/outLogin`);
}
